package dao;

import java.sql.Connection;
import java.sql.DriverManager;

public class DAO {
    private String DBDriver = "com.mysql.jdbc.Driver";
    private String DBURL = "jdbc:mysql://localhost/messageboard?useSSL=false&characterEncoding=UTF-8";
    private String user = "root";
    private String password = "284013";

    public Connection getConnection() {
        Connection conn = null;
        try {
            Class.forName(DBDriver);
            conn = DriverManager.getConnection(DBURL+"&user="+this.user+"&password="+this.password);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            System.out.println(e.getMessage());
            System.out.println("Driver");
        }
        return conn;
    }
}
